package pers.whj.util.tree;

public interface BinarySearchTree<T extends Comparable<T>> extends BinaryTree<T> {
    /**
     * get the min data
     *
     * @return min data
     */
    T min();

    /**
     * get the max data
     *
     * @return max data
     */
    T max();

    /**
     * precursor of given data, the maximum data on all data that less than given data
     *
     * @return precursor data
     */
    T precursor(T data);

    /**
     * successor of given data, the minimum data on all data that greater than given data
     *
     * @return successor data
     */
    T successor(T data);
}